<SCRIPT LANGUAGE="JavaScript"> 

    function tampil() {
        $("#hint").show("slow");
    }
    function sembunyi() {
        $("#hint").hide("slow");
    }

    function validation()
    {
        if( document.getElementById('ResumeAcademicId').value==""  )
        {
            document.getElementById('ResumeAcademicId').focus();
            document.getElementById('ResumeAcademicId').style.backgroundColor='#FF9';
            alert("Please fill your highest academic");
            document.getElementById('ResumeAcademicId').style.backgroundColor='#FFF';
            return false;
        }

        if (document.getElementById('available2').checked)
        {
            if( document.getElementById('ResumeDateAvaibleDay').value=="" || document.getElementById('ResumeDateAvaibleMonth').value=="" || document.getElementById('ResumeDateAvaibleYear').value=="" )
            {
                document.getElementById('ResumeDateAvaibleDay').focus();
                document.getElementById('ResumeDateAvaibleDay').style.backgroundColor='#FF9';
                document.getElementById('ResumeDateAvaibleMonth').style.backgroundColor='#FF9';
                document.getElementById('ResumeDateAvaibleYear').style.backgroundColor='#FF9';
                alert("Please fill the date");
                document.getElementById('ResumeDateAvaibleDay').style.backgroundColor='#FFF';
                document.getElementById('ResumeDateAvaibleMonth').style.backgroundColor='#FFF';            
                document.getElementById('ResumeDateAvaibleYear').style.backgroundColor='#FFF'; 
                return false;           
            }
        }        
        
        if(document.getElementById('exp3').checked)
        {
            if( isNaN(document.getElementById('ResumeMonthExp').value) || isNaN(document.getElementById('ResumeYearExp').value) )
            {
                document.getElementById('ResumeMonthExp').focus();
                document.getElementById('ResumeMonthExp').style.backgroundColor='#FF9';
                document.getElementById('ResumeYearExp').style.backgroundColor='#FF9';
                alert("Please fill the month & year experience with numeric value");
                document.getElementById('ResumeMonthExp').style.backgroundColor='#FFF';
                document.getElementById('ResumeYearExp').style.backgroundColor='#FFF';
                return false;
            } 
            else
            {
                if( document.getElementById('ResumeMonthExp').value>11 || ( document.getElementById('ResumeMonthExp').value==0 && document.getElementById('ResumeYearExp').value==0 ) )
                {
                    document.getElementById('ResumeMonthExp').focus();
                    document.getElementById('ResumeMonthExp').style.backgroundColor='#FF9';
                    document.getElementById('ResumeYearExp').style.backgroundColor='#FF9';
                    alert("Please fill the month & year experience with valid value");
                    document.getElementById('ResumeMonthExp').style.backgroundColor='#FFF';
                    document.getElementById('ResumeYearExp').style.backgroundColor='#FFF';
                    return false;            
                }
            
            }
        }
    

    
        if( document.getElementById('ResumeSalary').value.length!=0 && isNaN(document.getElementById('ResumeSalary').value) )
        {
            document.getElementById('ResumeSalary').focus();
            document.getElementById('ResumeSalary').style.backgroundColor='#FF9';
            alert("Please fill your salary with numeric charackters");
            document.getElementById('ResumeSalary').style.backgroundColor='#FFF';
            return false;
        }    
    }   
    
    function test()
    { 
        if (document.getElementById('available2').checked)
        {
            document.getElementById('ResumeDateAvaibleDay').disabled=false;
            document.getElementById('ResumeDateAvaibleMonth').disabled=false;
            document.getElementById('ResumeDateAvaibleYear').disabled=false;
        }  
        else
        {
            document.getElementById('ResumeDateAvaibleDay').disabled=true;
            document.getElementById('ResumeDateAvaibleMonth').disabled=true;
            document.getElementById('ResumeDateAvaibleYear').disabled=true;

        }
    }
    
    function test2()
    { 
        if (document.getElementById('exp3').checked)
        {
            document.getElementById('ResumeYearExp').disabled=false;
            document.getElementById('ResumeMonthExp').disabled=false;
        }  
        else
        {
            document.getElementById('ResumeYearExp').disabled=true;
            document.getElementById('ResumeMonthExp').disabled=true;

        }
    }
    
    function gpake()
    {
    
        document.getElementById('ResumeDateAvaibleDay').value="";
        document.getElementById('ResumeDateAvaibleMonth').value="";
        document.getElementById('ResumeDateAvaibleYear').value="";   
        
        document.getElementById('ResumeYearExp').value="0";
        document.getElementById('ResumeMonthExp').value="0";
    }
    
  
        
</SCRIPT>
<?php
e($javascript->link('jquery.js')); 
echo "<table class='table_resume'><tr>";
    echo "<td valign='top' width='260px'>";
    echo $this->element('menu_resume'); 
    echo "</td>";
    echo "<td class='pemisah'></td>";
    echo "<td valign='top'>";
    echo "<div class='form'>";
    echo "<h2> Resume Sumarry </h2>";
    echo "<hr color='#2A7EF7'>";
        echo "<div class='kotak2'>"; 
        echo $form->create('Resume',array('action'=>'summary','onsubmit'=>'return validation();'));
            echo $form->input('id',array('type'=>'hidden'));
		    echo $form->input('title',array('after'=>"  <img src='../img/hint.gif' onmouseover='tampil();' onmouseout='sembunyi();'>"));
		    echo $form->input('academic_id',array('label'=>'Higest Academic','empty'=>' ', 'after'=>"<span class='red'><sup>*</sup></span>"));
		    echo $form->input('score',array('size'=>'10'));
		    
            
            echo "<div class='input'>";
            $minyear=date("Y"); 
            echo "<label> Avaibility </label>";
            if($this->data['Resume']['avaibility']=='0')
            { echo  "<input type='radio' id='available1' name='data[Resume][avaibility]' value='0' onchange='test();' checked='true'> available "; }
            else
            { echo  " <input type='radio' id='available1' name='data[Resume][avaibility]' value='0' onchange='test();' > available "; }
            echo "<br>";
            if($this->data['Resume']['avaibility']=='1')
            {
                echo  "<label> &nbsp </label> <input type='radio' id='available2' name='data[Resume][avaibility]' value='1' onchange='test();' checked='true'> after ";
                echo $form->input('date_avaible',array('label'=>'', 'div'=>false, 'dateFormat'=>'DMY', 'minYear'=>$minyear) );
            }
            else
            {
                echo  " <label> &nbsp </label> <input type='radio' id='available2' name='data[Resume][avaibility]' value='1' onchange='test();'> after ";
                echo $form->input('date_avaible',array('label'=>'', 'div'=>false, 'empty'=>' ', 'selected'=>'empty', 'dateFormat'=>'DMY', 'disabled'=>'true', 'minYear'=>$minyear) );
            }
            echo "<br>";
            if($this->data['Resume']['avaibility']=='2')
            { echo  "<label> &nbsp </label> <input type='radio' id='available3' name='data[Resume][avaibility]' value='2' onchange='test();' checked='true'> not avaliable"; }
            else
            { echo  "<label> &nbsp </label> <input type='radio' id='available3' name='data[Resume][avaibility]' value='2' onchange='test();'> not avaliable"; }
            echo "</div>";
            
            echo "<div class='input'>";
            echo "<label> Experience </label>";
            if($this->data['Resume']['work_exp']=='0')
            { echo  "<input type='radio' id='exp1' name='data[Resume][work_exp]' value='0' onchange='test2();' checked='true'> Still school"; }
            else
            { echo  "<input type='radio' id='exp1' name='data[Resume][work_exp]' value='0' onchange='test2();'> Still school"; }
            echo "<br>";
            if($this->data['Resume']['work_exp']=='1')
            { echo  "<label> &nbsp </label><input type='radio' id='exp2' name='data[Resume][work_exp]' value='1' onchange='test2();' checked='true'> Fresh graduate"; }
            else
            { echo  "<label> &nbsp </label><input type='radio' id='exp2' name='data[Resume][work_exp]' value='1' onchange='test2();'> Fresh graduate"; }
            echo "<br>";
            if($this->data['Resume']['work_exp']=='2')
            {
                echo "<label> &nbsp </label><input type='radio' id='exp3' name='data[Resume][work_exp]' value='2' onchange='test2();' checked='true'> I have worked for";
                echo "<br><label> &nbsp </label> &nbsp&nbsp&nbsp&nbsp ";
                echo $form->input('month_exp',array('label'=>'', 'div'=>false, 'size'=>'2', 'maxLength'=>'2'));
                echo " month(s), ";
                echo $form->input('year_exp',array('label'=>'', 'div'=>false, 'size'=>'2', 'maxLength'=>'2'));
                echo " year(s)";
            }
            else
            {
                echo  "<label> &nbsp </label><input type='radio' id='exp3' name='data[Resume][work_exp]' value='2' onchange='test2();'> I have worked for";
                echo "<br><label> &nbsp </label> &nbsp&nbsp&nbsp&nbsp "; 
                echo $form->input('month_exp',array('label'=>'', 'div'=>false, 'disabled'=>'true' , 'size'=>'2', 'maxLength'=>'2'));
                echo " month(s), ";
                echo $form->input('year_exp',array('label'=>'', 'div'=>false, 'disabled'=>'true', 'size'=>'2', 'maxLength'=>'2'));
                echo " year(s)";
            }
            echo "</div>";
            
            
		    echo $form->input('vehicle',array('options'=>array(''=>'','none'=>'none','motorcycle'=>'motorcycle','car'=>'car')));
		    echo $form->input('salary',array('label'=>'Expected salary','after'=>' per month(s)'));
		    echo $form->input('travel',array('options'=>array(''=>'','will consider'=>'will consider','no'=>'no','yes'=>'yes')));
		    echo $form->input('relocate',array('options'=>array(''=>'','will consider'=>'will consider','no'=>'no','yes'=>'yes')));
		    echo $form->input('overseas',array('options'=>array(''=>'','will consider'=>'will consider','no'=>'no','yes'=>'yes')));
	    
            
            echo "<div class='input'><label> &nbsp </label><input type='submit' value='Save & Next'></div>";
        echo "</form>";
        echo "</div>";
        echo ":. <span class='red'>*</span> Required Field";
        echo "<br>:. For negotiable expected salary, just fill it blank";
    echo "</div>";
    echo "</td>";
    
echo "</tr></table>";   
 
?>         

<div id='hint' style='top:275px;left:695px;display:none'><b>Resume Title</b><br> Your resume title should clearly explain your career goal or career objective.<br> It is recommended that you state what you want (and qualified) to do.<br> Example : Web Developer experts in PHP & MySQL</div>
